package Thread;
//查看线程相关信息的一组方法
public class ThreadInfoDemo {
    public static void main(String[] args) {

        Thread main=Thread.currentThread();
        String name=main.getName();
        System.out.println(name);

        long id=main.getId();
        System.out.println(id);

        int priority=main.getPriority();
        System.out.println("优先级"+priority);
//是否为守护线程
       boolean daemon= main.isDaemon();
        System.out.println(daemon);
//是否活着
        boolean alive=main.isAlive();
        System.out.println(alive);
//是否被中断
        boolean interrupted=main.isInterrupted();
        System.out.println(interrupted);


    }
}
